package com.cxq.deadlock;

/**
 * Created by cxq on 2020/7/26.
 */
public class DeadLockTest {
    public static void main(String[] args) {

        //1 创建两个DeadRunnable的实例
        DeadLockRunnable deadLockRunnable1 = new DeadLockRunnable(1);
        DeadLockRunnable deadLockRunnable2 = new DeadLockRunnable(2);
        //2 创建两个线程
        Thread thread1 = new Thread(deadLockRunnable1,"线程1");
        Thread thread2 = new Thread(deadLockRunnable2,"线程2");
        //3 启动线程
        thread1.start();
        thread2.start();
    }


}
